<template>
	<div class="overvcontentTop">
		<div>
			<h3>{{examlist.name}}</h3>
			<div class="examInfo">
				<b><i>时间：</i>{{examlist.startTime}}</b>
				<b><i>年级：</i><em v-for="item in examlist.studentRange">{{item.gradeName}}</em></b>
				<b><i>考试模式：</i>{{examlist.optionalName}}</b>
				<b><i>上传方式：</i>本地识别后上传</b>
				<b><i>评阅方式：</i>{{examlist.markHubType==1?'全校阅卷':examlist.markHubType==2?'分班阅卷':examlist.markHubType==3?'导入成绩':examlist.markHubType==4?'先批后扫':'线上考试'}}</b>
			</div>
		</div>
		<span @click="addExam(examlist)">编辑考试</span>
	</div>
</template>

<script>
	import { get, post, del, put } from '../../request/api.js'
	export default{
		props:['addExamIshow'],
		data(){
			return{
				examlist:{},
				examobj:{},
			}
		},
		mounted() {
			this.examobjcontent = JSON.parse(sessionStorage.getItem('examContent'))
			this.examoverive(this.examobjcontent.id)
		},
		methods:{
			examoverive(id){
				get('/exam/details', { examId: id })
				.then(res => {
					//console.info(res)
					if(res.code==200){
						this.examlist = res.data
					}else{
						this.$message.error(res.message);
					}
				})
				.catch(error => {
					  // 处理错误
					  this.$message.error(error.message);
				});
			},
			// 新建考试
			addExam(obj){
				this.examobj=obj
				t
			}
		}
	}
</script>

<style scoped>
	.overvcontentTop{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding:24px;
	}
	.overvcontentTop h3{
		font-size:18px;
		font-weight:500;
		padding-bottom:15px;
	}
	.overvcontentTop span{
		width: 124px;
		height: 34px;
		background: #295CFF;
		border-radius: 10px;
		font-size: 14px;
		color: #FFFFFF;
		text-align: center;
		line-height:34px;
		cursor: pointer;
	}
	.examInfo{
		display: flex;
		align-items: center;
	}
	.examInfo b{
		font-weight: normal;
		font-size:14px;
		color:#333;
		position: relative;
		padding-right:14px;
		margin-right:14px;
	}
	.examInfo b i{
		font-style:normal;
		color:#8E96A4
	}
	.examInfo b::after{
		content:'';
		width: 1px;
		height: 8px;
		background:#DEE1E7;
		position:absolute;
		right:0;
		top:50%;
		transform: translateY(-50%);
	}
	.examInfo b:last-child::after{
		content:'';
		width: 1px;
		height: 8px;
		background:#fff;
		position:absolute;
		right:0;
		top:50%;
		transform: translateY(-50%);
	}
</style>